﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EntityModel
{
    /// <summary>
    /// 账号类
    /// </summary>
   public class EM_Account
    {
        public EM_Account()
        {
            Id = Guid.NewGuid();
            AddTime = DateTime.Now;
            IsDel = false;
            IsLock = false;
        }
        /// <summary>
        /// 唯一标识符
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public Guid Id { get; set; }
        /// <summary>
        /// 添加时间
        /// </summary>
        public DateTime AddTime { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTime? DelTime { get; set; }
        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsDel { get; set; }
        /// <summary>
        /// 是否锁定
        /// </summary>
        public bool IsLock { get; set; }
        /// <summary>
        /// 账户名
        /// </summary>
        [Required]
        [MaxLength(16)]
        [MinLength(8)]
        public string? Account { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [MaxLength(18)]
        [MinLength(6)]
        [Required]
        public string? Password { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        [StringLength(50)]
        public string? PhoneNumber { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        [StringLength(50)]
        public string? Email { get; set; }

        public EM_User? User { get; set; }

    }
}
